<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"chuangges.gitee.io","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="Hexo 是一个快速、简洁且高效的博客框架">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo + Github 搭建个人博客">
<meta property="og:url" content="https://chuangges.gitee.io/2019/02/09/1-hexo%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="闯哥要去流浪了">
<meta property="og:description" content="Hexo 是一个快速、简洁且高效的博客框架">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-02-08T18:31:41.000Z">
<meta property="article:modified_time" content="2023-12-15T06:37:22.144Z">
<meta property="article:author" content="chuangges">
<meta property="article:tag" content="前端技术栈">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://chuangges.gitee.io/2019/02/09/1-hexo%E5%8D%9A%E5%AE%A2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Hexo + Github 搭建个人博客 | 闯哥要去流浪了</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="闯哥要去流浪了" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">闯哥要去流浪了</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">愿你岁月可回首，且以深情共白头</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://chuangges.gitee.io/2019/02/09/1-hexo%E5%8D%9A%E5%AE%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/chuang.png">
      <meta itemprop="name" content="chuangges">
      <meta itemprop="description" content="chuangge's blog.">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="闯哥要去流浪了">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Hexo + Github 搭建个人博客
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-02-09 02:31:41" itemprop="dateCreated datePublished" datetime="2019-02-09T02:31:41+08:00">2019-02-09</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-12-15 14:37:22" itemprop="dateModified" datetime="2023-12-15T14:37:22+08:00">2023-12-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF%E6%A0%88/" itemprop="url" rel="index"><span itemprop="name">前端技术栈</span></a>
                </span>
            </span>

          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.4k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>
            <div class="post-description">Hexo 是一个快速、简洁且高效的博客框架</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="一、博客搭建"><a href="#一、博客搭建" class="headerlink" title="一、博客搭建"></a>一、博客搭建</h1><h2 id="安装-Node-Git"><a href="#安装-Node-Git" class="headerlink" title="安装 Node Git"></a>安装 Node Git</h2><blockquote>
<p>Git安装后可以创建 <code>ssh key</code> 并添加到 GitHub上, 这样配置之后就不再需要每次更新博客时都输入用户名和密码了</p>
</blockquote>
<h2 id="安装-hexo-框架"><a href="#安装-hexo-框架" class="headerlink" title="安装 hexo 框架"></a>安装 hexo 框架</h2>  <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">cnpm install -g hexo-cli    <span class="comment">// window安装</span></span><br><span class="line">sudo cnpm install -g hexo   <span class="comment">// mac安装</span></span><br><span class="line"></span><br><span class="line">cd blog            <span class="comment">//在新建的blog文件夹打开终端</span></span><br><span class="line">hexo init          <span class="comment">// 初始化</span></span><br><span class="line"></span><br><span class="line">hexo install       <span class="comment">// window安装依赖</span></span><br><span class="line">sudo npm install   <span class="comment">// mac安装依赖</span></span><br></pre></td></tr></table></figure>


<h2 id="本地测试-线下访问"><a href="#本地测试-线下访问" class="headerlink" title="本地测试(线下访问)"></a>本地测试(线下访问)</h2>  <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo g     <span class="comment">// 生成静态文件, 即 hexo generate</span></span><br><span class="line"></span><br><span class="line">hexo s     <span class="comment">// 启动本地服务器, 即 hexo server</span></span><br></pre></td></tr></table></figure>

<h2 id="云服务器部署-线上"><a href="#云服务器部署-线上" class="headerlink" title="云服务器部署(线上)"></a>云服务器部署(线上)</h2><blockquote>
<p>Github 是外国网站且禁止百度爬虫访问，所以会导致百度搜不到你的网站。可以做两手准备：国内采用Coding托管，国外采用GitHub托管，建议两者的用户名和密码保持一致  </p>
</blockquote>
<h3 id="配置步骤"><a href="#配置步骤" class="headerlink" title="配置步骤"></a>配置步骤</h3><ol>
<li>新建项目<br> GitHub：<code>username.github.io</code><br> Coding：<a target="_blank" rel="external nofollow noopener noreferrer" href="https://coding.net/">https://coding.net/</a></li>
<li>配置 SSH<br>* 检查：<code>cd ~/.ssh</code><br>* 生成：<code>ssh-keygen -t rsa -C &quot;17621538916@163.com&quot;</code><br>* 输入密码并回车<br>* 查看公钥：<code>cat ~/.ssh/id_rsa.pub</code> </li>
<li>添加公钥</li>
<li>基础配置<br>* 用户名：<code>git config --global user.name &quot;chuanggefighting&quot;</code><br>* 邮箱：<code>git config --global user.email &quot;17621538916@163.com&quot;</code> </li>
<li>测试连接：<code>ssh -T git@github.com、ssh -T git@git.coding.net</code></li>
<li>开启 Pages 服务</li>
</ol>
<h3 id="修改配置文件"><a href="#修改配置文件" class="headerlink" title="修改配置文件"></a>修改配置文件</h3><blockquote>
<p>码云是国内的，访问速度较快，但是每次更新版本后需要手动部署</p>
</blockquote>
  <figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> </span><br><span class="line">    <span class="attr">github:</span> <span class="string">https://github.com/chuanggefighting/chuanggefighting.github.io.git</span></span><br><span class="line">    <span class="comment"># coding: https://git.coding.net/chuanggefighting/chuanggefighting.coding.me.git     # Coding</span></span><br><span class="line">  <span class="attr">repository:</span> <span class="string">https://gitee.com/chuangges/chuangges.git</span>     <span class="comment"># 码云</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">master</span></span><br></pre></td></tr></table></figure>


<h3 id="上传到服务器"><a href="#上传到服务器" class="headerlink" title="上传到服务器"></a>上传到服务器</h3>  <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cnpm install hexo-deployer-git --save  <span class="comment">// 安装git部署插件</span></span><br><span class="line"></span><br><span class="line">hexo clean              <span class="comment">// 清除缓存</span></span><br><span class="line">hexo n post             <span class="comment">// 新建文章，即 hexo new post </span></span><br><span class="line">hexo g                  <span class="comment">// 编译博文生成静态文件, 即 hexo generate</span></span><br><span class="line">hexo d                  <span class="comment">// 部署到github, 即 hexo deploy</span></span><br><span class="line">hexo hexo g -d          <span class="comment">// 简化命令, 部署前生成静态文件</span></span><br></pre></td></tr></table></figure>


<h2 id="创建新页面"><a href="#创建新页面" class="headerlink" title="创建新页面"></a>创建新页面</h2><ol>
<li><strong>增加关于页</strong><br>1. 取消 about 前面的 #<br>2. hexo new page about<br>3. blog&#x2F;sources&#x2F;about&#x2F;index.md：自定义内容</li>
<li><strong>增加标签页</strong><br>1. 首先取消 next&#x2F;config.yml 文件中 tags 前面的 #<br>2. hexo new page tags<br>3. blog&#x2F;sources&#x2F;about&#x2F;index.md：<code>type: tags</code></li>
<li><strong>增加分类页</strong><br>1. 取消 categories 前面的 #<br>2. hexo new page categories<br>3. blog&#x2F;sources&#x2F;categories&#x2F;index.md：<code>type: categories</code></li>
<li><strong>增加归档页</strong><br>1. 取消 categories 前面的 #<br>2. hexo new page archive<br>3. blog&#x2F;sources&#x2F;archive&#x2F;index.md：<code>type: archive</code></li>
</ol>
<h1 id="二、博客管理"><a href="#二、博客管理" class="headerlink" title="二、博客管理"></a>二、博客管理</h1><h2 id="Next-主题配置"><a href="#Next-主题配置" class="headerlink" title="Next 主题配置"></a>Next 主题配置</h2><blockquote>
<p>为了避免主题更新报错可另存一份配置文件。首先在 blog&#x2F;source 目录下新建_data 文件夹，然后去复制 blog&#x2F;themes&#x2F;next&#x2F;_config.yml 到本地并改名为 next.yml，最后将 next.yml 放置在 _data，以后编辑 next.yml 即可。</p>
</blockquote>
<h2 id="博客源文件"><a href="#博客源文件" class="headerlink" title="博客源文件"></a>博客源文件</h2><blockquote>
<p>hexo d 是把本地源文件生成的静态网页文件同步到 github 而实现部署，但是本地源文件仍需要保存到个人电脑，为了方便在不同电脑上可以编辑管理，可以在github上另建分支。</p>
</blockquote>
<h2 id="个性化配置"><a href="#个性化配置" class="headerlink" title="个性化配置"></a>个性化配置</h2><ol>
<li><strong>Hexo配置</strong> (blog&#x2F;_config.yml)<br>* Site 站点配置(网站标题、作者、语言等)<br>* URL 网址配置(网址、根目录、链接格式等)<br>* Extensions 扩展配置(主题、插件等)<br>* 其他配置选项一般不需要修改</li>
<li><strong>主题配置</strong> (具体在博客优化部分)<br>* 安装主题：通过 git clone 下载到 blog&#x2F;themes<br>* 启动主题：修改 blog&#x2F;_config.yml 的theme选项<br>* 配置主题：修改 blog&#x2F;themes&#x2F;主题名&#x2F;_config.yml</li>
<li><strong>自定义域名配置</strong><br>* 购买域名<br>* 域名解析<br>* 添加 CNAME</li>
</ol>
<h2 id="Next-主题优化"><a href="#Next-主题优化" class="headerlink" title="Next 主题优化"></a>Next 主题优化</h2><ol>
<li><strong>实用性优化</strong><br>* 添加RSS：hexo-generator-feed<br>* 添加标签、分类等页面<br>* 设置网站 icon<br>* 添加侧边栏链接<br>* 增加版权信息<br>* 微信支付宝打赏功能<br>* 底部显示建站时间和图标的修改<br>* 外部链接优化：hexo-autonofollow<br>* 关闭网站动画：use_motion<br>* 设置第三方JS库：vendors<br>* 添加评论系统：leancloud<br>* 统计站点访客和阅读量：busuanzi<br>* 统计文章字数和阅读时间：symblos_count_time<br>* 添加文章分享功能：needmoreshare2<br>* 添加文章加密功能：hexo-blog-encrypt<br>* 添加图片的懒加载：hexo-lazyload-image<br>* 添加站内搜索功能：hexo-generator-searchdb<br>* 添加文章置顶功能：hexo-generator-index-pin-top<br>* 添加站点地图配置：hexo-generator-sitemap、hexo-generator-baidu-sitemap<br>* 在线联系：DaoVoice</li>
<li><strong>个性化优化</strong><br>* 添加页面加载动画：pace<br>* 添加背景动画：canvas_nest<br>* 添加宠物：hexo-helper-live2d<br>* 添加顶部阅读进度：reading_progress<br>* 点击出现桃心效果：clicklove.js<br>* 添加代码块复制按钮：clickboard.js<br>* 文章末尾统一添加 “文本结束” 标记<br>* 修改文章底部标签样式<br>* 右上角的 Github 样式<br>* 修改作者头像并旋转<br>* 文章添加阴影效果</li>
</ol>
<h1 id="三、Markdown-编写博文"><a href="#三、Markdown-编写博文" class="headerlink" title="三、Markdown 编写博文"></a>三、Markdown 编写博文</h1><h2 id="创建文章"><a href="#创建文章" class="headerlink" title="创建文章"></a>创建文章</h2><ul>
<li>站点目录下执行命令 hexo new title</li>
<li>指定目录下直接创建 source&#x2F;_post&#x2F;title.md</li>
</ul>
<h2 id="初始化设置"><a href="#初始化设置" class="headerlink" title="初始化设置"></a>初始化设置</h2><blockquote>
<p>使用命令创建文章时，Hexo 会根据文章的模板文件 &#x2F;scaffolds&#x2F;post.md 对新建文件进行初始化，可以根据需要自行修改。初始化后的文章头部除了可以设置文章标题、发布日期等基础信息外，还可以对文章添加标签、分类等，常用设置如下： </p>
</blockquote>
  <figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="attr">title:</span> <span class="string">my</span> <span class="string">blog</span></span><br><span class="line"><span class="attr">date:</span> <span class="number">2019-02-04 20:45:30</span></span><br><span class="line"><span class="attr">tags:</span> [<span class="string">Hexo</span>, <span class="string">MarkDown</span>] </span><br><span class="line"><span class="attr">categories:</span> <span class="string">学习笔记</span></span><br><span class="line"><span class="attr">keywords:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">Hexo</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">加密</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 预览文章摘要</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">Markdown语法的格式和注意点</span>  </span><br><span class="line"></span><br><span class="line"><span class="comment"># 预览加密文章摘要</span></span><br><span class="line"><span class="attr">password:</span>        <span class="comment"># 文章密码</span></span><br><span class="line"><span class="attr">abstract:</span> <span class="string">enter</span> <span class="string">password</span> <span class="string">to</span> <span class="string">read</span>      <span class="comment"># 文章摘要</span></span><br><span class="line"><span class="attr">message:</span> <span class="string">My</span> <span class="string">Birthday</span>      <span class="comment"># 密码提示</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 预览文章内容</span></span><br><span class="line"><span class="comment"># 在要显示的内容末尾添加more分隔符 &lt;!-- more --&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="meta">---</span></span><br></pre></td></tr></table></figure>


<h2 id="Markdown-语言"><a href="#Markdown-语言" class="headerlink" title="Markdown 语言"></a>Markdown 语言</h2><blockquote>
<p>一种可通过简单语法使普通文本具有一定格式的轻量级标记语言，主要特点是易读易写、支持嵌入 html、自动生成目录等。但是 Hexo 使用的 Github MarkDown（GFM）和 标准 MarkDown（MD）在语法上稍有不同，以下主要介绍的是 GFM 语法。</p>
</blockquote>
<ul>
<li>MD GFM 区别<ul>
<li>斜体：MD 使用 _ 或 *，GFM 只支持 *</li>
<li>自动链接：MD 使用 <url>，GFM 可直接使用 URL</url></li>
<li>代码块：MD 使用 4个空格开头，GFM 还可以使用 ``` 格式</li>
<li>其他：GFM 可以指定语言高亮，而且增加了 删除线、表格、锚点等</li>
</ul>
</li>
<li>常用语法<ul>
<li>标题：根据 # 的数量显示几级标题（1～6）</li>
<li>引用：根据 &gt; 的数量显示几级引用文本</li>
<li>转义：使用 \ 显示文本中的一些字符</li>
<li>强调：使用 * 或 _ 显示 斜体、粗体、粗斜体（1～3），~~ 显示删除</li>
<li>链接：行内式 [名字](地址 “描述”)，参考式 [名字][网址变量]</li>
<li>列表：无序列表使用 -、+ 或 *，有序列表则使用数字加 .</li>
<li>代码：行内代码使用 `，代码块则使用 4个空格 或 ```</li>
<li>表格：- 和 | 分割行和列，: 控制对其方式</li>
<li>图片：链接方法前面加 !</li>
</ul>
</li>
<li>次常用语法<ul>
<li>分段：两个空格</li>
<li>分隔线：在一行中使用三个以上的 *、-、_</li>
<li>换行：两个空格 + 回车 （引用中换行省略回车）</li>
<li>首行缩进：使用转义字符代替空格，或者使用html标签</li>
<li>脚注：使用 [^name] 定义，用来解释专业词汇等</li>
</ul>
</li>
<li>内嵌 Html：用于实现 Markdown 不支持的修改字体和颜色等功能。</li>
</ul>
  <figure class="highlight gherkin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="symbol">*</span>斜体文本<span class="symbol">*</span>  _斜体文本_  <span class="symbol">*</span><span class="symbol">*</span>粗体文本<span class="symbol">*</span><span class="symbol">*</span>  <span class="symbol">*</span><span class="symbol">*</span>粗体文本<span class="symbol">*</span><span class="symbol">*</span>  </span><br><span class="line"><span class="symbol">*</span><span class="symbol">*</span><span class="symbol">*</span>粗斜体文本<span class="symbol">*</span><span class="symbol">*</span><span class="symbol">*</span>  <span class="symbol">*</span><span class="symbol">*</span>_粗斜体文本<span class="symbol">*</span><span class="symbol">*</span>_  ~~删除一段文本~~</span><br><span class="line"></span><br><span class="line">&gt; 动物</span><br><span class="line">&gt;&gt; 水生动物</span><br><span class="line"></span><br><span class="line">[my blog](https://chuanggefighting.github.io/)   </span><br><span class="line">[Google][1] and [Baidu][2]</span><br><span class="line">[1]: http://google.com/   <span class="string">&quot;Google&quot;</span> </span><br><span class="line">[2]: http://baidu.com/    <span class="string">&quot;Baidu&quot;</span></span><br><span class="line"></span><br><span class="line">|<span class="string"> 指标类型 </span>|<span class="string"> 实测值 </span>|<span class="string">  质检类型 </span>|</span><br><span class="line">|<span class="string">  ----  </span>|<span class="string">  ----  </span>|<span class="string">  ----   </span>|</span><br><span class="line">|<span class="string">  长度   </span>|<span class="string">  100   </span>|<span class="string">  合格   </span>|</span><br><span class="line">|<span class="string">  宽度   </span>|<span class="string">  200   </span>|<span class="string">  返工   </span>|</span><br><span class="line">|<span class="string">  高度   </span>|<span class="string">  300   </span>|<span class="string">  报废   </span>|</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Python</span><br><span class="line"><span class="comment">#!/usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line">print &#x27;Hello World!</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">换行<span class="variable">&lt;br/&gt;</span></span><br><span class="line"><span class="variable">&lt;u&gt;</span>下划线文本<span class="variable">&lt;/u&gt;</span></span><br><span class="line"><span class="variable">&lt;span align=&quot;left&quot;&gt;</span>文本对齐<span class="variable">&lt;/span&gt;</span></span><br><span class="line"><span class="variable">&lt;span style=&quot;text-indent: 2em&quot;&gt;</span>首行缩进<span class="variable">&lt;/span&gt;</span> </span><br></pre></td></tr></table></figure>


    </div>

    
    
    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;margin-top:20px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      
    </div>
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>chuangges
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://chuangges.gitee.io/2019/02/09/1-hexo%E5%8D%9A%E5%AE%A2/" title="Hexo + Github 搭建个人博客">https://chuangges.gitee.io/2019/02/09/1-hexo博客/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/zh_CN" rel="external nofollow noopener noreferrer" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/2019/02/17/2-1-web%E5%BC%80%E5%8F%91%E9%A1%BB%E7%9F%A5/" rel="next" title="web 开发须知">
      web 开发须知 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA"><span class="nav-number">1.</span> <span class="nav-text">一、博客搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-Node-Git"><span class="nav-number">1.1.</span> <span class="nav-text">安装 Node Git</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-hexo-%E6%A1%86%E6%9E%B6"><span class="nav-number">1.2.</span> <span class="nav-text">安装 hexo 框架</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95-%E7%BA%BF%E4%B8%8B%E8%AE%BF%E9%97%AE"><span class="nav-number">1.3.</span> <span class="nav-text">本地测试(线下访问)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%83%A8%E7%BD%B2-%E7%BA%BF%E4%B8%8A"><span class="nav-number">1.4.</span> <span class="nav-text">云服务器部署(线上)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4"><span class="nav-number">1.4.1.</span> <span class="nav-text">配置步骤</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="nav-number">1.4.2.</span> <span class="nav-text">修改配置文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%8A%E4%BC%A0%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="nav-number">1.4.3.</span> <span class="nav-text">上传到服务器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E6%96%B0%E9%A1%B5%E9%9D%A2"><span class="nav-number">1.5.</span> <span class="nav-text">创建新页面</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%8D%9A%E5%AE%A2%E7%AE%A1%E7%90%86"><span class="nav-number">2.</span> <span class="nav-text">二、博客管理</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Next-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="nav-number">2.1.</span> <span class="nav-text">Next 主题配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8D%9A%E5%AE%A2%E6%BA%90%E6%96%87%E4%BB%B6"><span class="nav-number">2.2.</span> <span class="nav-text">博客源文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%AA%E6%80%A7%E5%8C%96%E9%85%8D%E7%BD%AE"><span class="nav-number">2.3.</span> <span class="nav-text">个性化配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Next-%E4%B8%BB%E9%A2%98%E4%BC%98%E5%8C%96"><span class="nav-number">2.4.</span> <span class="nav-text">Next 主题优化</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81Markdown-%E7%BC%96%E5%86%99%E5%8D%9A%E6%96%87"><span class="nav-number">3.</span> <span class="nav-text">三、Markdown 编写博文</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E6%96%87%E7%AB%A0"><span class="nav-number">3.1.</span> <span class="nav-text">创建文章</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96%E8%AE%BE%E7%BD%AE"><span class="nav-number">3.2.</span> <span class="nav-text">初始化设置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Markdown-%E8%AF%AD%E8%A8%80"><span class="nav-number">3.3.</span> <span class="nav-text">Markdown 语言</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="chuangges" src="" data-original="/images/chuang.png">
  <p class="site-author-name" itemprop="name">chuangges</p>
  <div class="site-description" itemprop="description">chuangge's blog.</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">39</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/chuangges" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;chuangges" rel="external nofollow noopener noreferrer" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/yourname" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;yourname" rel="external nofollow noopener noreferrer" target="_blank"><i class="fab fa-stack-overflow fa-fw"></i>StackOverflow</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://juejin.im/" title="https:&#x2F;&#x2F;juejin.im&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">掘金</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.nowcoder.com/" title="https:&#x2F;&#x2F;www.nowcoder.com&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">牛客网</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.docschina.org/" title="https:&#x2F;&#x2F;www.docschina.org&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">印记中文</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://tool.lu/" title="http:&#x2F;&#x2F;tool.lu&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">在线工具</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://tinypng.com/" title="https:&#x2F;&#x2F;tinypng.com&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">图片压缩</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://bigjpg.com/" title="https:&#x2F;&#x2F;bigjpg.com&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">图片放大</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://tool.chinaz.com/" title="https:&#x2F;&#x2F;tool.chinaz.com&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">站长工具</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://learn-anything.xyz/" title="https:&#x2F;&#x2F;learn-anything.xyz&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">Learn-Anything</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://stackoverflow.com/" title="https:&#x2F;&#x2F;stackoverflow.com&#x2F;" rel="external nofollow noopener noreferrer" target="_blank">Stack-Overflow</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">chuangge</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">1m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">15:14</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="external nofollow noopener noreferrer" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="external nofollow noopener noreferrer" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","model":{"jsonPath":"/live2dw/assets/tororo.model.json"},"display":{"position":"left","width":180,"height":360},"mobile":{"show":false},"react":{"opacityDefault":1,"opacityOnHover":1},"log":false,"tagMode":false});</script>
        <style>
            [bg-lazy] {
                background-image: none !important;
                background-color: #eee !important;
            }
        </style>
        <script>
            window.imageLazyLoadSetting = {
                isSPA: false,
                preloadRatio: 1,
                processImages: null,
            };
        </script><script>window.addEventListener("load",function(){var t=/\.(gif|jpg|jpeg|tiff|png)$/i,r=/^data:image\/[a-z]+;base64,/;Array.prototype.slice.call(document.querySelectorAll("img[data-original]")).forEach(function(a){var e=a.parentNode;"A"===e.tagName&&(e.href.match(t)||e.href.match(r))&&(e.href=a.dataset.original)})});</script><script>!function(e){e.imageLazyLoadSetting.processImages=t;var n=e.imageLazyLoadSetting.isSPA,i=e.imageLazyLoadSetting.preloadRatio||1,r=o();function o(){var t=Array.prototype.slice.call(document.querySelectorAll("img[data-original]")),e=Array.prototype.slice.call(document.querySelectorAll("[bg-lazy]"));return t.concat(e)}function t(){n&&(r=o());for(var t,a=0;a<r.length;a++)0<=(t=(t=r[a]).getBoundingClientRect()).bottom&&0<=t.left&&t.top<=(e.innerHeight*i||document.documentElement.clientHeight*i)&&function(){var t,e,n,i,o=r[a];e=function(){r=r.filter(function(t){return o!==t})},(t=o).hasAttribute("bg-lazy")?(t.removeAttribute("bg-lazy"),e&&e()):(n=new Image,i=t.getAttribute("data-original"),n.onload=function(){t.src=i,t.removeAttribute("data-original"),e&&e()},t.src!==i&&(n.src=i))}()}function a(){clearTimeout(t.tId),t.tId=setTimeout(t,500)}t(),document.addEventListener("scroll",a),e.addEventListener("resize",a),e.addEventListener("orientationchange",a)}(this);</script></body>
</html>
